function new = optimize_results(g1, g2, g3, a1, a2, a3)

new = [];
new_vec = [];

if(isempty(g1)) 
    new_vec = [new_vec a1]; 
else
    new_vec = [new_vec g1]; 
end

if(isempty(g2)) 
    new_vec = [new_vec a2]; 
else
    new_vec = [new_vec g2]; 
end

if(isempty(g3))
    new_vec = [new_vec a3];
else
    new_vec = [new_vec g3];
end

if(~isempty(new_vec))
    for i=1:length(new_vec)
        duplicate = false;
        if(isempty(new))
            new = [new new_vec(i)];
        else
            for j=1:length(new)
                if(new_vec(i) == new(j))
                    duplicate = true;
                end
            end
            if(duplicate == false)
                new = [new new_vec(i)];
            end
        end
    end
end

new = sort(new);